package com.bsh.api;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.bsh.mybatis.model.ArticleWithBLOBs;
import com.bsh.service.ArticleService;

/**
 * 用户协议
 * 
 * @author gsh
 * @since 0.0.1
 * 
 */
@Controller
public class AgreementController {
	private static Logger log = LoggerFactory.getLogger(AgreementController.class);

	@Autowired
	HttpServletRequest request;
	@Autowired
	HttpServletResponse response;
	@Autowired
	private ArticleService artServ;

	/**
	 * 协议
	 * @param artType
	 * help		帮助
	 * about	关于	
	 * partner	合作伙伴
	 * register	用户注册
	 * merchant 成为商户
	 * 
	 * @return
	 */
	@RequestMapping(value = "/api/v1/agreement/{artType}")
	public ModelAndView view(@PathVariable(value = "artType") String artType) {
		ModelAndView mv = new ModelAndView();
		mv.setViewName("/pages/article/agreementForApi");
		ArticleWithBLOBs article = artServ.findByTag("app_"+artType);
		mv.addObject("article", article);
		return mv;
	}
  

}
